Public Class ACHelpTextBox
   'Inherits System.Windows.Forms.DataGridTextBox
   Inherits TextBox
   Public WithEvents btnAyuda As Button
   Public Event ButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)

   Public Sub New()
      MyBase.New()
      btnAyuda = New Button
      btnAyuda.BackColor = System.Drawing.SystemColors.Control
      btnAyuda.Size = New System.Drawing.Size(21, 21)
      btnAyuda.Dock = DockStyle.Right
      btnAyuda.Cursor = Cursors.Arrow

      btnAyuda.Image = Global.ACControles.My.Resources.busqueda

      MyBase.Controls.Add(btnAyuda)
      btnAyuda.BringToFront()
   End Sub

   Protected Overrides Sub Dispose(ByVal disposing As Boolean)
      MyBase.Dispose(disposing)
   End Sub

   Public Overrides Property Text() As String
      Get
         Return MyBase.Text
      End Get
      Set(ByVal value As String)
         MyBase.Text = value
      End Set
   End Property


   Public Overrides Property Cursor() As System.Windows.Forms.Cursor
      Get
         Return MyBase.Cursor
      End Get
      Set(ByVal value As System.Windows.Forms.Cursor)
         MyBase.Cursor = value
      End Set
   End Property

   Public Shadows Property Tag() As Object
      Get
         Return MyBase.Tag
      End Get
      Set(ByVal value As Object)
         MyBase.Tag = value
      End Set
   End Property

   Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
      MyBase.OnTextChanged(e)
   End Sub

   Private Sub btnAyuda_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAyuda.Click
      RaiseEvent ButtonClick(sender, e)
   End Sub

   Private Sub ACHelpTextBox_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
      If e.KeyCode = Keys.F2 Then
         Me.btnAyuda_Click(sender, e)
      End If
   End Sub
End Class
